package entity

import "strings"

const (
	UserKind = 1
)

type NodeTemplateReviewer struct {
	ID string `json:"id"`
	// Kind 类型 1：用户
	Kind           int    `json:"kind"`
	NodeTemplateID string `json:"nodeTemplateId"`
	// ReviewerNos 业务审批者编号列表，多个编号以逗号分隔
	ReviewerNos string `json:"reviewerNos"`
	// ReviewerIDs 审批者ID列表，多个ID以逗号分隔
	ReviewerIDs string `json:"reviewerIDs"`
}

// NewNodeTemplateReviewer 创建节点模板审批者实体的工厂方法
func NewNodeTemplateReviewer(id string, kind int, nodeTemplateID string, reviewerNos []string, reviewerIDs []string) NodeTemplateReviewer {
	return NodeTemplateReviewer{
		ID:             id,
		Kind:           kind,
		NodeTemplateID: nodeTemplateID,
		ReviewerNos:    strings.Join(reviewerNos, ","),
		ReviewerIDs:    strings.Join(reviewerIDs, ","),
	}
}



func (n NodeTemplateReviewer) GetReviewerIDs() []string {
	if n.ReviewerIDs == "" {
		return []string{}
	}
	return strings.Split(n.ReviewerIDs, ",")
}

func (n NodeTemplateReviewer) GetReviewerNos() []string {
	if n.ReviewerNos == "" {
		return []string{}
	}
	return strings.Split(n.ReviewerNos, ",")
}
